package net.xdclass.service;

import net.xdclass.entity.ProductOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import net.xdclass.enums.ProductOrderPayTypeEnum;
import net.xdclass.model.OrderMessage;
import net.xdclass.request.ConfirmOrderRequest;
import net.xdclass.request.RepayOrderRequest;
import net.xdclass.utils.JsonData;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lixin
 * @since 2024-09-03
 */
public interface IProductOrderService extends IService<ProductOrder> {

    /**
     * 创建订单
     * @param confirmOrderRequest
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest confirmOrderRequest);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    /**
     * 队列监听，定时关单
     * @param orderMessage
     * @return
     */
    boolean closeProductOrder(OrderMessage orderMessage);

    /**
     * 处理支付结果回调通知
     * @param alipay
     * @param paramsMap
     * @return
     */
    JsonData handlerOrderCallbackMap(ProductOrderPayTypeEnum alipay, Map<String, String> paramsMap);

    /**
     * 分页查询我的订单列表
     * @param page
     * @param size
     * @param state
     * @return
     */
    Map<String, Object> myOrderPage(int page, int size, String state);

    /**
     * 订单二次支付
     * @param repayOrderRequest
     * @return
     */
    JsonData repay(RepayOrderRequest repayOrderRequest);
}
